<?php

if (isset ($_GET['etu'])) {

	$connexion = mysql_connect("localhost", "root", "");
	mysql_select_db("etudiant", $connexion);
	
	extract($_GET);
	getDonnee($etu);
}else{
	echo "{}";
}

function getDonnee($etu) {
	$sql = "SELECT note
		FROM etudiant
			
		WHERE nom = '".$etu."'";
	/*
	$sql = "SELECT *
		FROM `cliques`
		WHERE auteur = '".$etu."'";
	*/
	
	//echo $sql;
	$rs = mysql_query($sql) or die('Requête invalide : ' . mysql_error());
	$arrG = array();
	While ($arr = mysql_fetch_array($rs)){
		$arrG[] = $arr;
	}
	echo json_encode($arrG);
	
}

?>